import request from '@/utils/request'

// 获取七牛token
export function qiniuToken() {
  return request.get('/v1/common/qiniu/token')
}

/** @module 账户管理 */
export function login(data) {
  return request.post('/v1/user/login', data)
}

export function logout(): Promise<any> {
  return new Promise((resolve) => {
    resolve({
      code: '0000',
      msg: '成功',
      data: null
    })
  })
}

export function getUserDetail(data:any = {}): Promise<any> {
  return request.get('/v1/user/info', { params: data })
}

// 获取验证码
export function checkCode() {
  return request.get('/v1/user/check/code')
}

export function userList(data) {
  return request.get('/v1/user/list', { params: data })
}

export function userBind(data) {
  return request.post('/v1/user/bind', data)
}

// 获取用户剧列表
export function dramaList(data) {
  return request.get('/v1/drama/user/list', { params: data })
}

// 获取用户帖子列表
export function topicList(data) {
  return request.get('/v1/topic/user/list', { params: data })
}

export function userUpd(data) {
  return request.post('/v1/user/upd', data)
}

// 发放积分
export function scoreAdd(data) {
  return request.post('/v1/common/score/add', data)
}
